<template>
  <v-app-bar :elevation="2">
    <template v-slot:prepend>
      <v-app-bar-nav-icon @click="drawer = !drawer"></v-app-bar-nav-icon>
    </template>

    <v-app-bar-title>
      <span>Tauri with vuetify</span>
    </v-app-bar-title>
    <template v-slot:append>
      <v-btn icon="mdi-window-minimize" @click="minimize"></v-btn>
      <v-btn icon="mdi-close" @click="exit"></v-btn>
    </template>
  </v-app-bar>
  <v-navigation-drawer v-model="drawer" app>
    <!-- 这里可以添加菜单项 -->
    <v-list>
      <v-list-item>
        <v-list-item-title>菜单项 1</v-list-item-title>
      </v-list-item>
      <v-list-item>
        <v-list-item-title>菜单项 2</v-list-item-title>
      </v-list-item>
    </v-list>
  </v-navigation-drawer>
</template>
<script setup>
import {ref} from 'vue'
import {invoke} from "@tauri-apps/api/core";

const drawer = ref(false)

function exit() {
  invoke("exit_app")
}

function minimize() {
  invoke("minimize_app")
}
</script>
